/**
 * Naive implementation of the 1d discrete fourier transform with
 * complex inputs and outputs, based on the definition. Runs in O(n²).
 */
function naiveFourierTransform(complexInputs) {
    var complexOutput = [];

    for (var k = 0; k < complexInputs.length; k++) {
        var sum = new Complex(0, 0);
        for (var n = 0; n < complexInputs.length; n++) {
            var exponent = (new Complex(0,-1)).mul(2*Math.PI*k*n/complexInputs.length);
            sum = sum.add(complexInputs[n].mul(exponent.exp());
        }
    }
}
